<template>
	<view>
		<u-navbar title="设置"> </u-navbar>
		<view style="background: #fff; margin: 20rpx">
			<u-cell-group>
				<u-cell icon="lock" title="修改密码" @click="goxgmm"></u-cell>
				<!-- <u-cell icon="integral-fill" title="退出登陆"></u-cell> -->
			</u-cell-group>
		</view>
		<view style="margin-top: 40rpx; padding: 0 40rpx">
			<u-button type="primary" text="退出登陆" @click="LogOut"></u-button>
		</view>
		<zmodal ref="zmodal" />
	</view>
</template>

<script>
	export default {
		data() {
			return {};
		},

		methods: {
			goxgmm() {
				uni.navigateTo({
					url: "/pageshome/changePwd/changePwd"
				})
			},
			LogOut() {
				this.$refs.zmodal.init({
					title: "退出登陆",
					content: "确定退出登陆吗？",
					confirm: async () => {
						console.log(1111);
						await this.$store.dispatch("user/LogOut");
						uni.reLaunch({
							url: "/pages/login/login",
						});
						this.$u.toast("退出成功");
						this.$u.back();
					},
				});
			},
		},
	};
</script>

<style></style>